_PPPP_OOOO_LLLL_LLLL_HHHH_UUUU_PPPP A device hangup.
_PPPP_OOOO_LLLL_LLLL_EEEE_RRRR_RRRR A device error.
_PPPP_OOOO_LLLL_LLLL_RRRR_DDDD_NNNN_OOOO_RRRR_MMMM Normal data is available to be read.
_PPPP_OOOO_LLLL_LLLL_WWWW_RRRR_NNNN_OOOO_RRRR_MMMM Normal data may be written without blocking (same as
_PPPP_OOOO_LLLL_LLLL_OOOO_UUUU_TTTT).
_PPPP_OOOO_LLLL_LLLL_RRRR_DDDD_BBBB_AAAA_NNNN_DDDD Out-of-band data is available to be read.
_PPPP_OOOO_LLLL_LLLL_WWWW_RRRR_BBBB_AAAA_NNNN_DDDD Out-of-band data may be written without blocking.
A driver that supports polling must provide a _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure for each
minor device supported by the driver. On systems where they are
available, the driver should use the _pppp_hhhh_aaaa_llll_llll_oooo_cccc(D3) function to allocate the
_pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure, and use the _pppp_hhhh_ffff_rrrr_eeee_eeee(D3) function to free the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd
structure, if necessary.
The _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure must be initialized to zeros prior to its first
use (when _pppp_hhhh_aaaa_llll_llll_oooo_cccc is used to allocate the structure, this is done
automatically).
The definition of the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure is not included in the DDI/DKI,
and can change across releases. It should be treated as a ``black box''
by the driver; none of its fields may be referenced. Although the size
of the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure is guaranteed to remain the same across
releases, it is good practice for drivers not to depend on the size of
the structure.
The driver must implement the polling discipline itself. Each time the
driver detects a pollable event, it should call _pppp_oooo_llll_llll_wwww_aaaa_kkkk_eeee_uuuu_pppp(D3), passing
to it the event that occurred and the address of the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure
associated with the device. Note that _pppp_oooo_llll_llll_wwww_aaaa_kkkk_eeee_uuuu_pppp should be called with
only one event at a time.
When the driver's _pppp_oooo_llll_llll entry point is called, the driver should check if
any of the events requested in _e_v_e_n_t_s have occurred. The driver should
store the mask, consisting of the subset of _eeee_vvvv_eeee_nnnn_tttt_ssss that are pending, in
the _ssss_hhhh_oooo_rrrr_tttt pointed to by _r_e_v_e_n_t_s_p. Note that this mask may be 0 if none
of the events are pending. In this case, the driver should check the
_a_n_y_y_e_t flag and, if it is zero, store the address of the device's
_pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd structure in the pointer pointed at by _p_h_p_p and also store the
value of the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd's generation number at the time of the poll in the
unsigned integer pointed to by _g_e_n_p.
The pollhead's generation value must be sampled either while a state lock
is held that will hold off any call to _pppp_oooo_llll_llll_wwww_aaaa_kkkk_eeee_uuuu_pppp(D3) on the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd by
the lower portion of the driver, or it must be taken _b_e_f_o_r_e the check is
made for any pending events; _pppp_oooo_llll_llll_wwww_aaaa_kkkk_eeee_uuuu_pppp(D3) increments the _pppp_oooo_llll_llll_hhhh_eeee_aaaa_dddd's
generation number each time it is called. The generation number is used
to solve the race condition that exists for the caller of the poll()